import React,{useState,useEffect} from 'react'
import {getRightMessage} from "../../api/ask"
import "./Right.scss"
export default function Right() {
    const [rightMessage, setRightMessage] = useState({ numberQuestions: 0, replyCount: 0, numberReplies: 0 })
    const init = async () => {
        let res = await getRightMessage()
        setRightMessage(res.data.data);
    }
    useEffect(()=>{
        init()
    },[])
    return (
            <div className="askRight_Bottom">
                    <h3>我的问答</h3>
                    <p>
                        <img alt="" src="/file_service/group1/M00/00/1E/rBsCHWDQSsSAU_AMAAAC8SbhdoU94.jpeg" />
                        <span>黄辉</span>
                    </p>
                    <p>
                        <span className="questionspan">问</span>
                        <span>提了<b>{rightMessage.numberQuestions}</b>个问题， <b>{rightMessage.numberReplies}</b>人进行了回答</span>
                    </p>
                    <p>
                        <span className="answerspan">答</span>
                        <span>回答了<b>{rightMessage.replyCount}</b>个问题</span>
                    </p>
                </div>
    )
}
